package cn.kgc.service;

import cn.kgc.dao.DeviceMapper;
import cn.kgc.pojo.Device;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("devicesService")
public class DevicesServiceImpl implements DevicesService{
    @Resource
    private DeviceMapper deviceMapper;
    @Override
    public List<Device> queryAllDevice(String deviceName,int currentNo,int pageSize) {
        return deviceMapper.queryAllDevice(deviceName,(currentNo-1)*pageSize,pageSize);
    }

    @Override
    public int queryCount(String deviceName) {
        return deviceMapper.queryCount(deviceName);
    }

    @Override
    public Device queryDeviceById(int id) {
        return deviceMapper.queryDeviceById(id);
    }
}
